#ifndef __USYSCALL_H__
#define __USYSCALL_H__

#include <global/header/types.h>
#include <global/header/syscall.h>
#include <libcommon/stdarg.h>

void kprintf(const char *fmt, ...);
void vkprintf(const char *fmt, va_list va);

void upriv_set(void *upriv);

typedef void(*kmsg_dispatcher_f)(void **buf, uint32_t cap, uint32_t head, uint32_t tail);
void kmsg_init(kmsg_dispatcher_f disp);
void kmsg_return(uint32_t head, int busy);
void kmsg_clean_busy(void);

physaddr_t ppage_alloc(int num, int dma);
int        ppage_free(physaddr_t addr);
physaddr_t mmap_get(void *addr);
int        mmap_set(void *addr, physaddr_t paddr);

void uthread_create(const char *name, uintptr_t entry, uintptr_t upriv, uintptr_t ustack_top);
uint32_t process_io_buffer(uint32_t *buf, uint32_t count);
void dummy_work(int workset_pages);
void exam_addr(void *addr);
void yield(void);

#endif
